extends layout

block content
  h1.my-3= title
  .row
    .col-12.col-md-8
      .card.mt-2
        .card-header.bg-primary 上传图片
        .card-body 
          form(action="/upload",method="post",enctype="multipart/form-data")
            .form-group.row
              .col-12.col-md-3
                label.col-form-label(for='file') 浏览
              .col-12.col-md-9
                input.form-control(type='file', name='imagefile')
            .form-group.row
              .col-12.col-md-3
                label.col-form-label(for='title') 标题
              .col-12.col-md-9
                input.form-control(type='text', name='title')
            .form-group.row
              .col-12.col-md-3
                label.col-form-label(for='description') 描述
              .col-12.col-md-9
                textarea.form-control(name='description', rows='3')
            .form-group.row
              .col-12.text-right
                button.btn.btn-success(type='submit')
                  i.fa.fa-cloud-upload.mr-2
                  | 上传图片
      .card.mt-2
        .card-header 最近图片
        .card-body 
          .row
            each image in images
              .col-12.col-md-4.mt-2
                a(href='/image/' + image._id)
                  .card
                    img.card-img-top(src='/uploads/' + image.filename)     
    .col-12.col-md-4
      .card.mt-2
        .card-header 统计信息
        .card-body 图片的统计
      .card.mt-2
        .card-header 最受欢迎
        .card-body 最受欢迎图片
      .card.mt-2
        .card-header 最近评论
        .card-body 最近评论
  include footer.pug

  
